<%@page import="com.system.dao.RoleDao"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../common.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'userEdit.jsp' starting page</title>
  </head>
  
  <script type="text/javascript">
	  	function doSave(){
			if(doCheck()){
				var map = Form.formToBean("winForm");
		  		ajax.remoteCall("com.system.dao.DrugRateDao:update",[map],function(reply){
	  			var result = reply.getResult();
	  			alert(result.value);
	  			if(result.type == "success"){
	  				var dlg = Dialog.getInstance("view");
	  	    		dlg.getParam("window").location.reload();;
	  	    		dlg.close();
	  			}
	  		});
			}
		}
	  	
    	function doCheck(){
    		
    		var regExp = /^[0-9]*[1-9][0-9]*$/;
    		var rate = $.trim($("#rate").val());
    		
    		if($.trim(rate) == ""){
    			alert("费率不能为空");
    			return false;
    		}
    		
   			if((!regExp.test(rate))){
   				alert("请输入正整数");
    			return false;
   			}
    		
    		return true;
    	}
    	
    </script>
  
  <body>
   <form id="winForm" name="winForm">
   		<input name="id" type="hidden" value="${param.id}">
   		<input name="value" type="hidden" value="${param.value}">
  		<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
	  		<tr>
				<td valign="top" align="left">	
					<div title="出库" style="padding:10px;">
						<table>
							<tr height="40px" valign="bottom">
								<td>
									<font color="#FF0000">*</font>费率(%)：
								</td>
								<td>
									<input type="text" name="rate" id="rate" class="textbox" style="width:150px"/>
								</td>
							</tr>
							<tr height="30px" valign="bottom">
								<td colspan="2">
									<img src="${path}/images/tip.png" border="0" width="20px" height="15px" />
									<font color="green" style="font-size: 10px">温馨提示：费率不能为空且在0至100范围内！</font>
								</td>
							</tr>
						</table>
					</div>
				</td>
			</tr>
  		</table>
	</form>
  </body>
</html>
